package org.whuims.pois.model;

import org.apache.struts.action.ActionForm;

import javax.persistence.*;

/**
 * Created by 声伟 on 2014/5/18 0018.
 */
@Entity
@Table(name = "view")
public class View extends ActionForm{
    private int id;
    private String cName;
    private String fName;
    private String vWord;
    private String view;
    private String content;
    private String target;
    private String title;
    private String url;
    private String site;
    private String time;
    private Long siteId;
    private Long topicId;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "cName", nullable = true, insertable = true, updatable = true, length = 255)
    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    @Basic
    @Column(name = "fName", nullable = true, insertable = true, updatable = true, length = 255)
    public String getfName() {
        return fName;
    }

    public void setfName(String fName) {
        this.fName = fName;
    }

    @Basic
    @Column(name = "vWord", nullable = true, insertable = true, updatable = true, length = 255)
    public String getvWord() {
        return vWord;
    }

    public void setvWord(String vWord) {
        this.vWord = vWord;
    }

    @Basic
    @Column(name = "view", nullable = true, insertable = true, updatable = true, length = 65535)
    public String getView() {
        return view;
    }

    public void setView(String view) {
        this.view = view;
    }

    @Basic
    @Column(name = "content", nullable = true, insertable = true, updatable = true, length = 255)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "target", nullable = true, insertable = true, updatable = true, length = 255)
    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    @Basic
    @Column(name = "title", nullable = true, insertable = true, updatable = true, length = 65535)
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "url", nullable = true, insertable = true, updatable = true, length = 255)
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "site", nullable = true, insertable = true, updatable = true, length = 255)
    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    @Basic
    @Column(name = "time", nullable = true, insertable = true, updatable = true, length = 255)
    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Basic
    @Column(name = "site_id", nullable = true, insertable = true, updatable = true)
    public Long getSiteId() {
        return siteId;
    }

    public void setSiteId(Long siteId) {
        this.siteId = siteId;
    }

    @Basic
    @Column(name = "topic_id", nullable = true, insertable = true, updatable = true)
    public Long getTopicId() {
        return topicId;
    }

    public void setTopicId(Long topicId) {
        this.topicId = topicId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        View view1 = (View) o;

        if (id != view1.id) return false;
        if (cName != null ? !cName.equals(view1.cName) : view1.cName != null) return false;
        if (content != null ? !content.equals(view1.content) : view1.content != null) return false;
        if (fName != null ? !fName.equals(view1.fName) : view1.fName != null) return false;
        if (site != null ? !site.equals(view1.site) : view1.site != null) return false;
        if (siteId != null ? !siteId.equals(view1.siteId) : view1.siteId != null) return false;
        if (target != null ? !target.equals(view1.target) : view1.target != null) return false;
        if (time != null ? !time.equals(view1.time) : view1.time != null) return false;
        if (title != null ? !title.equals(view1.title) : view1.title != null) return false;
        if (topicId != null ? !topicId.equals(view1.topicId) : view1.topicId != null) return false;
        if (url != null ? !url.equals(view1.url) : view1.url != null) return false;
        if (vWord != null ? !vWord.equals(view1.vWord) : view1.vWord != null) return false;
        if (view != null ? !view.equals(view1.view) : view1.view != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (cName != null ? cName.hashCode() : 0);
        result = 31 * result + (fName != null ? fName.hashCode() : 0);
        result = 31 * result + (vWord != null ? vWord.hashCode() : 0);
        result = 31 * result + (view != null ? view.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (target != null ? target.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (site != null ? site.hashCode() : 0);
        result = 31 * result + (time != null ? time.hashCode() : 0);
        result = 31 * result + (siteId != null ? siteId.hashCode() : 0);
        result = 31 * result + (topicId != null ? topicId.hashCode() : 0);
        return result;
    }
}
